package com.txts.road.app.user.model.dto;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 用户表单对象
 *
 * @author baoyr
 * @since 2025-07-17 10:43
 */
@Getter
@Setter
@Schema(description = "用户表单对象")
public class UserDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long id;

    @Schema(description = "手机号")
    @Size(max=20, message="手机号长度不能超过20个字符")
    private String phone;

    @Schema(description = "密码")
    @Size(max=255, message="密码长度不能超过255个字符")
    private String password;

    @Schema(description = "昵称")
    @Size(max=50, message="昵称长度不能超过50个字符")
    private String nickname;

    @Schema(description = "头像URL")
    @Size(max=500, message="头像URL长度不能超过500个字符")
    private String avatar;

    @Schema(description = "用户类型：1-普通用户，2-管理员 ")
    private Integer userType;

    @Schema(description = "状态：1-正常，2-禁用")
    private Integer status;

    @Schema(description = "最后登录时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginTime;

    @Schema(description = "最后登录IP")
    @Size(max=50, message="最后登录IP长度不能超过50个字符")
    private String lastLoginIp;

   


}
